package tablature;

import java.io.Serializable;

/**
 * Enum: TimeSignature.java
 * Description: Enumeration for time signatures.
 * @author et
 */
public enum TimeSignature implements Serializable
{
    FOURFOUR ("4/4", 4, 4, "1e+a2e+a3e+a4e+a");


    private final String beatName;
    private final int beatsPerMeasure;
    private final int beatSize;
    private final String timingLine;

    /**
     * Constructor for TimeSignature
     * @param beatName - the beat's name.
     * @param beatsPerMeasure - the beats per measure
     * @param beatSize - the beat size
     * @param timingLine - the timing line (used by the tablature metronome).
     */
    TimeSignature(String beatName, int beatsPerMeasure, int beatSize, String timingLine)
    {
        this.beatName = beatName;
        this.beatsPerMeasure = beatsPerMeasure;
        this.beatSize = beatSize;
        this.timingLine = timingLine;
    }

    /**
     * Gets the beat name for this time signature
     * @return beatName - the beat name
     */
    public String getBeatName()
    {
        return beatName;
    }

    /**
     * Gets the number of beats per measure.
     * @return beatsPerMeasure - number of beats per measure.
     */
    public int getBeatsPerMeasure()
    {
        return beatsPerMeasure;
    }

    /**
     * Gets the beat size.
     * @return beatSize - the beat size.
     */
    public int getBeatSize()
    {
        return beatSize;
    }

    /**
     * Gets the timing line
     * @return timingLine - the timing line.
     */
    public String getTimingLine()
    {
        return timingLine;
    }

    /**
     * Gets the string representation.
     * @return beatName - the beat's name
     */
    public String toString()
    {
        return beatName;
    }

}
